package com.xiaolin.structure.linked.bothway;

/**
 * @ClassName BothWayLinkedListTest
 * @Description TODO
 * @Detail detail
 * @Author MyPC
 * @Date 2020/11/5
 * @Version 1.0
 */
public class BothWayLinkedListTest {
    public static void main(String[] args) {
        BothWayLinkedList<Student> linkedList=new BothWayLinkedList<>();
        Student s1=new Student(1);
        Student s2=new Student(2);
        Student s3=new Student(3);
        linkedList.add(s1);
        linkedList.add(s2);
        linkedList.add(s3);
        System.out.println(linkedList.size);
        System.out.println(linkedList.get(1).age);
        linkedList.remove(1);
        System.out.println(linkedList.size);
        System.out.println(linkedList.get(1).age);
    }

    /**
     * @ClassName Student
     * @Description 节点数据
     * @Detail detail
     * @Author MyPC
     * @Date 2020/11/5
     * @Version 1.0
     */
    static class Student{
        int age;

        public Student(int age){
            this.age=age;
        }

        public void setAge(int age) {
            this.age = age;
        }
    }
}
